package io.renren.modules.app.enums;

import java.util.Objects;

/**
 * 出库订单状态
 * create by znr48268 on 2018/12/12
 */
public enum OutOrderStatusEnum {
    初始化(0, "初始化"),
    待出库(1, "待出库"),
    出库中(2, "出库中"),
    操作完成(3, "操作完成"),

    出库数量不一致(4, "出库数量不一致"),
    出库完成(5, "出库完成"),

    复核数量不一致(6, "复核数量不一致"),
    复核完成(7, "复核完成"),

    订单完成(8, "订单完成");
    private Integer value;
    private String text;

    OutOrderStatusEnum(int i, String s) {
        this.value = i;
        this.text = s;

    }

    public static OutOrderStatusEnum getEnumByValue(Integer value) {
        for (OutOrderStatusEnum item : OutOrderStatusEnum.values()) {
            if (Objects.equals(value, item.getValue())) {
                return item;
            }
        }
        return null;
    }

    public static String getTextByValue(Integer value) {
        if (value != null) {
            for (OutOrderStatusEnum item : OutOrderStatusEnum.values()) {
                if (Objects.equals(value, item.getValue())) {
                    return item.getText();
                }
            }
        }
        return "";
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
